{extend name="base/index"/}
{block name="page_location"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item"><a href="{:url('index/index')}">管理中心</a></li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>会员管理</li>
				</ol>
			</div>
			<h4 class="page-title"> 所有会员 </h4>
		</div>
	</div>
</div>
{/block}
{block name="body"}
<div class="row" id="member_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<form class="form-inline" style="margin-bottom:10px;">
					<div class="input-group">
						<div class="input-group-prepend">
							<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">选择状态</button>
							<div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 37px, 0px);">
								<a href="javascript:;" class="dropdown-item check_select_btn" attr-type="all" attr-bind="check_id">全选</a>
								<a href="javascript:;" class="dropdown-item check_select_btn" attr-type="reverse" attr-bind="check_id">反选</a>
								<a href="javascript:;" class="dropdown-item check_select_btn" attr-type="cancel" attr-bind="check_id">取消</a>								
							</div>
						</div>
						<div class="input-group-prepend">
							<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">操作选中的</button>
							<div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 37px, 0px);">
								<a href="javascript:;" class="dropdown-item Fast_Bat" attr-type="enable" attr-model="member" attr-class=".check_id">启用</a>
								<a href="javascript:;" class="dropdown-item Fast_Bat" attr-type="disable" attr-model="member" attr-class=".check_id">禁用</a>
								<a href="javascript:;" class="dropdown-item Fast_Bat" attr-type="del" attr-model="member" attr-class=".check_id">删除</a>
							</div>
						</div>						
						<input type="text" class="form-control kw" placeholder="会员名/昵称/邮件/手机/QQ号码" name="kw" aria-describedby="basic-addon1">
						<div class="input-group-append">
							<button class="btn btn-dark search_btn" attr-ipt="kw" attr-url="{:url('member/index')}" type="button">搜索</button>
						</div>
					</div>
				</form>
				<div class="table-responsive-lg">
					<form action="" method="post" id="member_list_frm">
						<table class="table table-hover">
							<thead>
								<tr>
									<th>选择</th>
									<th>会员名</th>
									<th>头像</th>
									<th>级别</th>
									<th>邮箱/手机</th>
									<th>昵称</th>
									<th>余额</th>
									<th>积分</th>
									<th>状态</th>
									<th>最近登录时间</th>
									<th>最近登录IP</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								{volist name='list' id="data"}
								<tr>
									<td>
										<div class="custom-control custom-checkbox">
											<input type="checkbox" class="custom-control-input check_id" id="check_id{$data.id}" value="{$data.id}" name="check_id[]">
											<label class="custom-control-label" for="check_id{$data.id}">ID:{$data.id}</label>
										</div>											
									</td>
									<td>{$data.username} <br /><span class="label label-info">{$data.type}</span></td>
									<td><a href="javascript:;"><img class="list_facepic preview_img" src="{$data.facepic|default='/static/admin/images/nopic.png'}" /></a></td>
									<td>
										{switch name="data.group"}
											{case value="1"}<span class="badge badge-primary">普通会员</span>{/case}
											{case value="2"}<span class="badge badge-primary">铜牌会员</span>{/case}
											{case value="3"}<span class="badge badge-primary">银牌会员</span>{/case}
											{case value="4"}<span class="badge badge-primary">金牌会员</span>{/case}
										{/switch}
									</td>
									<td>
										{$data.email}<br />
										<span class="badge badge-primary">{$data.mobile}</span>
									</td>
									<td>{$data.nickname}</td>
									<td><i class="iconfont icon-dollar"></i> {$data.balance} 元</td>
									<td>{$data.integral}</td>
									<td>
										{eq name="data.status" value="0"}
										<a href="javascript:;" attr-id="{$data.id}" attr-model="member" attr-field="status" attr-val="1" class="badge badge-primary Fast_Action">正常</a>
										{else /}
										<a href="javascript:;" attr-id="{$data.id}" attr-model="member" attr-field="status" attr-val="0" class="badge badge-secondary Fast_Action">禁用</a>
										{/eq}
									</td>
									<td title="{$data.logintime|date="Y-m-d H:i:s",###}"><span class="badge badge-primary">{$data.logintime|date="m-d H:i",###}</span></td>
									<td>{$data.loginip}</td>
									<td>
										<div class="btn-group mb-2">
											<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">操作</button>
											<div class="dropdown-menu">
												<a class="dropdown-item edit_btn" href="javascript:;" attr-id="{$data.id}">查看详情</a>
												<a class="dropdown-item passwd_btn" href="javascript:;" attr-id="{$data.id}" data-toggle="modal" data-target="#passwd_box">修改密码</a>
												<!-- <a class="dropdown-item login_btn" href="javascript:;" attr-id="{$data.id}">立即登录</a> -->
												<a class="dropdown-item Fast_Del" href="javascript:;" attr-id="{$data.id}" attr-model="member">删除</a>
											</div>
										</div>
									</td>
								</tr>
								{/volist}
							</tbody>
						</table>
						<div class="pagination pagination-small txtcenter">
						{$pagelist}
						</div>
					</form>
				</div>
				<!-- end table-responsive-->
			</div>
			<!-- end card body-->
		</div>
		<!-- end card -->
	</div>
	<!-- end col-->
</div>
{/block}
{block name="modal_dig"}
<!-- Modal -->
<div class="modal fade" id="passwd_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title" id="myModalLabel">修改密码</h4>
		<button type="button" class="close" data-dismiss="modal">x</button>
      </div>
      <div class="modal-body">
        <form action="#" class="form-horizontal" id="edit_passwd_frm">
        	<input type="hidden" name="id" value="" />    	
			<div class="form-group row mb-1">
			    <label class="col-4 col-form-label">新密码：</label>
			    <div class="col-5">
			        <input type="text" name="newpassword" placeholder="请输入会员密码" class="password_input form-control ipt_check" value="" data-type="password" nullmsg="会员新密码不能为空" errormsg="会员新密码只能由6到12位的字符组成" data-len="6-12" repeated="repassword" repeated-msg="两次输入的密码不一致" passwordStrong="1" StrongMsg="您的密码强度不够" >
			        <span class="font-13 text-muted"></span>
			    </div>
			</div>
			<div class="form-group row mb-1">
			    <label class="col-4 col-form-label">确认新密码：</label>
			    <div class="col-5">
			        <input type="text" name="repassword" placeholder="请重新输入会员密码" class="password_input form-control" value="">
			        <span class="font-13 text-muted"></span>
			    </div>
			</div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary Fast_Form_Post" attr-frm="#edit_passwd_frm" attr-callback="reload" attr-model="member" attr-active="update_password"><i class="iconfont icon-inboxin-fill"></i> 保存修改</button>
      </div>
    </div>
  </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__PLUGIN__/PCAS/PCASClass.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak={$Config.baidumap_ak}"></script>
{/block}